(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 12.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       158,          7]
NotebookDataLength[     23222,        536]
NotebookOptionsPosition[     21942,        506]
NotebookOutlinePosition[     22281,        521]
CellTagsIndexPosition[     22238,        518]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell["Polynomial Blending", "Text",
 CellChangeTimes->{{3.814779503543106*^9, 
  3.8147795063429317`*^9}},ExpressionUUID->"ea1f0884-a36c-4f84-9de2-\
d27b5afcdcc4"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"left", "[", "s_", "]"}], ":=", 
  RowBox[{"lb", "+", 
   RowBox[{"lm", " ", "s"}]}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"right", "[", "s_", "]"}], ":=", 
  RowBox[{"rb", "+", 
   RowBox[{"rm", " ", 
    RowBox[{"(", 
     RowBox[{"s", "+", 
      FractionBox[
       RowBox[{"lb", "-", "rb", "+", 
        RowBox[{
         RowBox[{"(", 
          RowBox[{"lm", " ", "-", "rm"}], ")"}], "sMid"}]}], "rm"]}], 
     ")"}]}]}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"blend", "[", "s_", "]"}], ":=", 
  RowBox[{
   RowBox[{"a", " ", 
    SuperscriptBox["s", "5"]}], "+", 
   RowBox[{"b", " ", 
    SuperscriptBox["s", "4"]}], "+", 
   RowBox[{"c", " ", 
    SuperscriptBox["s", "3"]}], "+", 
   RowBox[{"d", " ", 
    SuperscriptBox["s", "2"]}], "+", 
   RowBox[{"e", " ", "s"}], "+", "f"}]}]}], "Input",
 CellChangeTimes->{{3.814779523518959*^9, 3.814779584287847*^9}, {
  3.8147804198139257`*^9, 3.814780430477427*^9}, {3.814780504670632*^9, 
  3.814780527934971*^9}, {3.814781894335999*^9, 3.8147819444396763`*^9}},
 CellLabel->"In[3]:=",ExpressionUUID->"70d3cac5-9a8c-4a5d-93af-56b7bb88d7be"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"resultBlendAll", "=", 
  RowBox[{"Solve", "[", 
   RowBox[{
    RowBox[{"{", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{
       RowBox[{"blend", "[", "0", "]"}], "\[Equal]", 
       RowBox[{"left", "[", 
        RowBox[{"sMid", "-", "sAbs"}], "]"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{
        RowBox[{"blend", "'"}], "[", "0", "]"}], "\[Equal]", 
       RowBox[{
        RowBox[{"left", "'"}], "[", 
        RowBox[{"sMid", "-", "sAbs"}], "]"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{
        RowBox[{"blend", "''"}], "[", "0", "]"}], "\[Equal]", 
       RowBox[{
        RowBox[{"left", "''"}], "[", 
        RowBox[{"sMid", "-", "sAbs"}], "]"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"blend", "[", 
        RowBox[{"2", "sAbs"}], "]"}], "\[Equal]", 
       RowBox[{"right", "[", 
        RowBox[{"sMid", "+", "sAbs"}], "]"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{
        RowBox[{"blend", "'"}], "[", 
        RowBox[{"2", "sAbs"}], "]"}], "\[Equal]", 
       RowBox[{
        RowBox[{"right", "'"}], "[", 
        RowBox[{"sMid", "+", "sAbs"}], "]"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{
        RowBox[{"blend", "''"}], "[", 
        RowBox[{"2", "sAbs"}], "]"}], "\[Equal]", 
       RowBox[{
        RowBox[{"right", "''"}], "[", 
        RowBox[{"sMid", "+", "sAbs"}], "]"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{
        RowBox[{"blend", "[", "sAbs", "]"}], "-", 
        RowBox[{"left", "[", "sMid", "]"}]}], "\[Equal]", "maxDiff"}]}], 
     "\[IndentingNewLine]", "}"}], ",", 
    RowBox[{"{", 
     RowBox[{
     "a", ",", "b", ",", "c", ",", "d", ",", "e", ",", "f", ",", "sAbs"}], 
     "}"}]}], "]"}]}]], "Input",
 CellChangeTimes->{{3.8147796975767117`*^9, 3.8147798210816107`*^9}, {
  3.8147798588031063`*^9, 3.81477989768192*^9}, {3.814780039291904*^9, 
  3.814780064179306*^9}, {3.814780102196363*^9, 3.8147801422919607`*^9}, {
  3.8147802074778643`*^9, 3.814780213004444*^9}, {3.8147802541493673`*^9, 
  3.814780256564538*^9}, {3.8147803089660263`*^9, 3.814780320133307*^9}, {
  3.814780362150041*^9, 3.814780378453538*^9}, {3.8147804726323013`*^9, 
  3.8147805822313633`*^9}, {3.8147817570711308`*^9, 3.814781759046762*^9}, {
  3.814782169753715*^9, 3.8147821700732117`*^9}, {3.8147822593625*^9, 
  3.8147822726510277`*^9}, {3.814784271000598*^9, 3.814784277089135*^9}, {
  3.814787231868183*^9, 3.814787262533352*^9}},
 CellLabel->"In[6]:=",ExpressionUUID->"2c3a7d7e-16fa-4dd7-8830-bacb4cea9c30"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"{", 
   RowBox[{
    RowBox[{"a", "\[Rule]", "0"}], ",", 
    RowBox[{"b", "\[Rule]", 
     RowBox[{"-", 
      FractionBox[
       RowBox[{"27", " ", 
        SuperscriptBox[
         RowBox[{"(", 
          RowBox[{"lm", "-", "rm"}], ")"}], "4"]}], 
       RowBox[{"65536", " ", 
        SuperscriptBox["maxDiff", "3"]}]]}]}], ",", 
    RowBox[{"c", "\[Rule]", 
     RowBox[{"-", 
      FractionBox[
       RowBox[{"9", " ", 
        SuperscriptBox[
         RowBox[{"(", 
          RowBox[{"lm", "-", "rm"}], ")"}], "3"]}], 
       RowBox[{"1024", " ", 
        SuperscriptBox["maxDiff", "2"]}]]}]}], ",", 
    RowBox[{"d", "\[Rule]", "0"}], ",", 
    RowBox[{"e", "\[Rule]", "lm"}], ",", 
    RowBox[{"f", "\[Rule]", 
     FractionBox[
      RowBox[{
       RowBox[{"3", " ", "lb", " ", "lm"}], "+", 
       RowBox[{"16", " ", "lm", " ", "maxDiff"}], "-", 
       RowBox[{"3", " ", "lb", " ", "rm"}], "+", 
       RowBox[{"3", " ", 
        SuperscriptBox["lm", "2"], " ", "sMid"}], "-", 
       RowBox[{"3", " ", "lm", " ", "rm", " ", "sMid"}]}], 
      RowBox[{"3", " ", 
       RowBox[{"(", 
        RowBox[{"lm", "-", "rm"}], ")"}]}]]}], ",", 
    RowBox[{"sAbs", "\[Rule]", 
     RowBox[{"-", 
      FractionBox[
       RowBox[{"16", " ", "maxDiff"}], 
       RowBox[{"3", " ", 
        RowBox[{"(", 
         RowBox[{"lm", "-", "rm"}], ")"}]}]]}]}]}], "}"}], "}"}]], "Output",
 CellChangeTimes->{{3.814787262938306*^9, 3.8147872703768883`*^9}},
 CellLabel->"Out[6]=",ExpressionUUID->"39e4091c-8a78-4975-b334-d83516fdc673"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"resultBlend", "=", 
  RowBox[{"Solve", "[", 
   RowBox[{
    RowBox[{"{", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{
       RowBox[{"blend", "[", "0", "]"}], "\[Equal]", 
       RowBox[{"left", "[", 
        RowBox[{"sMid", "-", "sAbs"}], "]"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{
        RowBox[{"blend", "'"}], "[", "0", "]"}], "\[Equal]", 
       RowBox[{
        RowBox[{"left", "'"}], "[", 
        RowBox[{"sMid", "-", "sAbs"}], "]"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{
        RowBox[{"blend", "''"}], "[", "0", "]"}], "\[Equal]", 
       RowBox[{
        RowBox[{"left", "''"}], "[", 
        RowBox[{"sMid", "-", "sAbs"}], "]"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"blend", "[", 
        RowBox[{"2", "sAbs"}], "]"}], "\[Equal]", 
       RowBox[{"right", "[", 
        RowBox[{"sMid", "+", "sAbs"}], "]"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{
        RowBox[{"blend", "'"}], "[", 
        RowBox[{"2", "sAbs"}], "]"}], "\[Equal]", 
       RowBox[{
        RowBox[{"right", "'"}], "[", 
        RowBox[{"sMid", "+", "sAbs"}], "]"}]}], ",", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{
        RowBox[{"blend", "''"}], "[", 
        RowBox[{"2", "sAbs"}], "]"}], "\[Equal]", 
       RowBox[{
        RowBox[{"right", "''"}], "[", 
        RowBox[{"sMid", "+", "sAbs"}], "]"}]}]}], "\[IndentingNewLine]", 
     "}"}], ",", 
    RowBox[{"{", 
     RowBox[{"a", ",", "b", ",", "c", ",", "d", ",", "e", ",", "f"}], "}"}]}],
    "]"}]}]], "Input",
 CellChangeTimes->{{3.814787291387918*^9, 3.814787301412025*^9}},
 CellLabel->"In[8]:=",ExpressionUUID->"5fa940a2-232d-4655-ab8b-4eec0c4265ca"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"{", 
   RowBox[{
    RowBox[{"a", "\[Rule]", "0"}], ",", 
    RowBox[{"b", "\[Rule]", 
     RowBox[{"-", 
      FractionBox[
       RowBox[{
        RowBox[{"-", "lm"}], "+", "rm"}], 
       RowBox[{"16", " ", 
        SuperscriptBox["sAbs", "3"]}]]}]}], ",", 
    RowBox[{"c", "\[Rule]", 
     RowBox[{"-", 
      FractionBox[
       RowBox[{"lm", "-", "rm"}], 
       RowBox[{"4", " ", 
        SuperscriptBox["sAbs", "2"]}]]}]}], ",", 
    RowBox[{"d", "\[Rule]", "0"}], ",", 
    RowBox[{"e", "\[Rule]", "lm"}], ",", 
    RowBox[{"f", "\[Rule]", 
     RowBox[{"lb", "-", 
      RowBox[{"lm", " ", "sAbs"}], "+", 
      RowBox[{"lm", " ", "sMid"}]}]}]}], "}"}], "}"}]], "Output",
 CellChangeTimes->{3.814787301877789*^9},
 CellLabel->"Out[8]=",ExpressionUUID->"6788aa1f-2f90-4e97-a0c4-af1abc3e1de3"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Plot", "[", 
  RowBox[{
   RowBox[{
    RowBox[{"{", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"left", "[", "s", "]"}], ",", "\[IndentingNewLine]", 
      RowBox[{"right", "[", "s", "]"}], ",", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{
        RowBox[{"blend", "[", "s", "]"}], "/.", "resultBlend"}], "/.", 
       RowBox[{"{", 
        RowBox[{"sAbs", "\[Rule]", "0.5"}], "}"}]}]}], "\[IndentingNewLine]", 
     "}"}], "/.", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{"lb", "\[Rule]", "2"}], ",", 
      RowBox[{"lm", "\[Rule]", 
       RowBox[{"-", "1"}]}], ",", 
      RowBox[{"sMid", "\[Rule]", "1.1"}], ",", 
      RowBox[{"rb", "\[Rule]", "1"}], ",", 
      RowBox[{"rm", "\[Rule]", "0.5"}]}], "}"}]}], ",", 
   RowBox[{"{", 
    RowBox[{"s", ",", "0.4", ",", "1.6"}], "}"}]}], "]"}]], "Input",
 CellChangeTimes->{{3.814780590255458*^9, 3.8147805907026167`*^9}, {
  3.814780949393561*^9, 3.8147809552415953`*^9}, {3.814781810015246*^9, 
  3.8147818384388523`*^9}, {3.8147822417707644`*^9, 3.81478225195382*^9}},
 CellLabel->"In[34]:=",ExpressionUUID->"479fe0d6-47b2-463e-ae25-8b9557d62f70"],

Cell[BoxData[
 GraphicsBox[{{{}, {}, 
    TagBox[
     {RGBColor[0.368417, 0.506779, 0.709798], AbsoluteThickness[1.6], Opacity[
      1.], LineBox[CompressedData["
1:eJxFlGs01AkAxW1SUqcIZYdD2qKXV3X2NFSXmiwbmzQmiZMeUgrNxtQqj7bH
GiGhxpQyBgdFZZtk0wPFUJJK2f+MR17DjMEYZsZfpZ09Z8/ZD/fc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X48YZkBepsLROPSCfj5zHImgn8ebOweOzpifiya0vx5Vn8eXAo8Unsx
n0561tauM8Bzi9PvDrVbmHcJWffyg/Nwdy7ZIg39iiHSO354Hnhue2odx3xL
/p6vcT0yD6VPxZI/YP414K1zcj4zDy+9cxWmKzFfqsm/tguYh29BOc2mtQTs
CRfLtqqch9tx7Bu+t2A/qxT+d5x7AYjArXNqQwRclPs71sdvAXgrb/4cx3OB
p9nU25tDC0C70vyjdhsd3qUaNHzftwhsSuvtKSM60MTvihrhOU60f8PxowF0
yG5vFXq0dgmq9tpz8pXQ4WzezE0D1yV4U0BPe9JFh0uNig2Tb5bgs/yHo11s
JKzQ+WxLFJlwN2+jeowyCRP//tC03M0EjQqpXts9mHMynwiz72FCk0xihJoK
CeU6Pt2OakwgIt+RX1RJsIjrPrBlHxNEZ/LNdfZiLpZOli86jP+/LHR/Xgdz
zBGepXw8F7ONWcidNyFBeeu392auTJDlbPr3gCkJYvMPa3+7McGCZuQqbkbC
XM65c7YeeE7+oX/vtTkJWeOvhyV8mNC2SE+QsyRhMiyuPTcc3ac+990Gc56F
Y4kJjQnu971ftZ7EHLZNM+LnZRyvQbEs8xQJN15NaJyOYkKsaoLboTMkaAsd
rhJLZEJQreRKmT0JOyek4l5fw/GF33wPd8Cc+nDRNSQZn8em8h5rzNFjDuVS
g6l4/X+adzicMUerRvyKS2PCy+jcrGH0A44TA5oZTHBoCI9udCGhdECp8Ucm
E7o1m/ySXElIquK4kZ3NhP45CWc3NxL+D+OoVF0=
       "]]},
     Annotation[#, "Charting`Private`Tag$6863#1"]& ]}, {}},
  AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948],
  Axes->{True, True},
  AxesLabel->{None, None},
  AxesOrigin->{0.4, 0.4000000244897959},
  DisplayFunction->Identity,
  Frame->{{False, False}, {False, False}},
  FrameLabel->{{None, None}, {None, None}},
  FrameTicks->{{Automatic, 
     Charting`ScaledFrameTicks[{Identity, Identity}]}, {Automatic, 
     Charting`ScaledFrameTicks[{Identity, Identity}]}},
  GridLines->{None, None},
  GridLinesStyle->Directive[
    GrayLevel[0.5, 0.4]],
  ImagePadding->All,
  Method->{
   "DefaultBoundaryStyle" -> Automatic, 
    "DefaultGraphicsInteraction" -> {
     "Version" -> 1.2, "TrackMousePosition" -> {True, False}, 
      "Effects" -> {
       "Highlight" -> {"ratio" -> 2}, "HighlightPoint" -> {"ratio" -> 2}, 
        "Droplines" -> {
         "freeformCursorMode" -> True, 
          "placement" -> {"x" -> "All", "y" -> "None"}}}}, "DefaultMeshStyle" -> 
    AbsolutePointSize[6], "ScalingFunctions" -> None, 
    "CoordinatesToolOptions" -> {"DisplayFunction" -> ({
        (Identity[#]& )[
         Part[#, 1]], 
        (Identity[#]& )[
         Part[#, 2]]}& ), "CopiedValueFunction" -> ({
        (Identity[#]& )[
         Part[#, 1]], 
        (Identity[#]& )[
         Part[#, 2]]}& )}},
  PlotRange->{{0.4, 1.6}, {0.4000000244897959, 1.5999999755102041`}},
  PlotRangeClipping->True,
  PlotRangePadding->{{
     Scaled[0.02], 
     Scaled[0.02]}, {
     Scaled[0.05], 
     Scaled[0.05]}},
  Ticks->{Automatic, Automatic}]], "Output",
 CellChangeTimes->{{3.814780585303237*^9, 3.814780592869084*^9}, {
  3.8147809517519703`*^9, 3.81478095753754*^9}, {3.814781810666019*^9, 
  3.814781840272695*^9}, {3.814782244356616*^9, 3.814782252219132*^9}},
 CellLabel->"Out[34]=",ExpressionUUID->"8ce4c685-1cfd-465e-a94d-4b52257a12e5"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{"ToString", "[", 
  RowBox[{
   RowBox[{"Simplify", "[", 
    RowBox[{"resultBlend", "[", 
     RowBox[{"[", 
      RowBox[{"1", ",", "6", ",", "2"}], "]"}], "]"}], "]"}], ",", "CForm"}], 
  "]"}], "\[IndentingNewLine]", 
 RowBox[{"CopyToClipboard", "[", "%", "]"}]}], "Input",
 CellChangeTimes->{{3.814780597743034*^9, 3.814780636798799*^9}, {
  3.814780707736005*^9, 3.814780748015781*^9}, {3.8147807850806103`*^9, 
  3.814780785143717*^9}, {3.8147821784975986`*^9, 3.814782178569324*^9}, {
  3.814782295290853*^9, 3.814782295329864*^9}, {3.8147823462991743`*^9, 
  3.814782346362447*^9}, {3.81478237925187*^9, 3.8147823937227507`*^9}, {
  3.814784263360217*^9, 3.81478426633566*^9}, {3.814787316765634*^9, 
  3.814787321755981*^9}, {3.8147873580136833`*^9, 3.814787396508493*^9}},
 CellLabel->"In[21]:=",ExpressionUUID->"d3adbc7b-8349-4567-aa18-08e75e8013d4"],

Cell[BoxData["\<\"lb + lm*(-sAbs + sMid)\"\>"], "Output",
 CellChangeTimes->{{3.814780600649522*^9, 3.814780637322711*^9}, {
   3.814780708293789*^9, 3.8147807484131317`*^9}, 3.8147807857654037`*^9, 
   3.81478217891681*^9, {3.8147822810808163`*^9, 3.81478229555334*^9}, 
   3.814782346666561*^9, {3.8147823796678247`*^9, 3.814782394118228*^9}, {
   3.814784266706871*^9, 3.814784278974018*^9}, {3.814787319381741*^9, 
   3.814787322811455*^9}, {3.8147873584364367`*^9, 3.8147873967792788`*^9}},
 CellLabel->"Out[21]=",ExpressionUUID->"f13ac165-4f18-4396-a389-b895b32d95d3"]
}, Open  ]]
},
WindowSize->{1292, 1169},
WindowMargins->{{-1631, Automatic}, {46, Automatic}},
FrontEndVersion->"12.0 for Linux x86 (64-bit) (April 8, 2019)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[558, 20, 163, 3, 36, "Text",ExpressionUUID->"ea1f0884-a36c-4f84-9de2-d27b5afcdcc4"],
Cell[724, 25, 1147, 32, 98, "Input",ExpressionUUID->"70d3cac5-9a8c-4a5d-93af-56b7bb88d7be"],
Cell[CellGroupData[{
Cell[1896, 61, 2596, 60, 216, "Input",ExpressionUUID->"2c3a7d7e-16fa-4dd7-8830-bacb4cea9c30"],
Cell[4495, 123, 1572, 45, 61, "Output",ExpressionUUID->"39e4091c-8a78-4975-b334-d83516fdc673"]
}, Open  ]],
Cell[CellGroupData[{
Cell[6104, 173, 1744, 46, 193, "Input",ExpressionUUID->"5fa940a2-232d-4655-ab8b-4eec0c4265ca"],
Cell[7851, 221, 842, 25, 55, "Output",ExpressionUUID->"6788aa1f-2f90-4e97-a0c4-af1abc3e1de3"]
}, Open  ]],
Cell[CellGroupData[{
Cell[8730, 251, 1147, 27, 124, "Input",ExpressionUUID->"479fe0d6-47b2-463e-ae25-8b9557d62f70"],
Cell[9880, 280, 10546, 193, 240, "Output",ExpressionUUID->"8ce4c685-1cfd-465e-a94d-4b52257a12e5"]
}, Open  ]],
Cell[CellGroupData[{
Cell[20463, 478, 886, 16, 55, "Input",ExpressionUUID->"d3adbc7b-8349-4567-aa18-08e75e8013d4"],
Cell[21352, 496, 574, 7, 35, "Output",ExpressionUUID->"f13ac165-4f18-4396-a389-b895b32d95d3"]
}, Open  ]]
}
]
*)

